#ifndef __RINGBUFF__
#define __RINGBUFF__

#define GROW_SIZE 2

typedef struct 
{
    void** elements;
    int start;
    int size;
    int max_size;
} RingBuffer;

/* Creates a new RingBuffer with the given initial size */
RingBuffer* ringbuff_init(int start_size);

/* Gets the element at the beginning of the buffer. Returns NULL if empty*/
void* ringbuff_get(RingBuffer* buffer);

/* Puts the given element at the end of the buffer. Retuns 1 if it was added, 0 otherwise */
int ringbuff_put(RingBuffer* buffer, void* element);

#endif /* __RINGBUFF__ */